home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgramD2.iso
/
Borland
/
Borland C++ V5.02
/
SERVICES.PAK
/
REF.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-06
|
1KB
|
48 lines
//----------------------------------------------------------------------------
// Borland Services Library
// Copyright (c) 1993, 1997 by Borland International, All Rights Reserved
//
//$Revision: 5.5 $
//
// Implementation of class TReference -- base class for reference counting
//
//----------------------------------------------------------------------------
#if !defined(CLASSLIB_REF_H)
#define CLASSLIB_REF_H
#if !defined(CLASSLIB_DEFS_H)
# include <classlib/defs.h>
#endif
#if defined(BI_COMP_BORLANDC)
# include <ref.h>
#else
#if defined(BI_NAMESPACE)
namespace ClassLib {
#endif
class _EXPCLASS TReference {
public:
_RTLENTRY TReference(unsigned short initRef = 0) : Refs(initRef) { }
void _RTLENTRY AddReference() { Refs++; }
unsigned short _RTLENTRY References() { return Refs; }
unsigned short _RTLENTRY RemoveReference() { return --Refs; }
private:
unsigned short Refs; // Number of references to this block
};
#if defined(BI_NAMESPACE)
} // namespace ClassLib
#endif
#endif // else if BI_COMP_BORLANDC
#if defined(BI_OLDNAMES)
# define BI_Reference TReference
#endif
#endif // CLASSLIB_REF_H